home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / pgp20src.zip / ZTAILOR.H < prev    next >
C/C++ Source or Header  |  1992-08-15  |  4KB  |  166 lines

  1. /* tailor.h -- Not copyrighted 1991 Mark Adler */
  2.  
  3. /* const's are inconsistently used across ANSI libraries--kill for all
  4.    header files. */
  5. #define const
  6.  
  7.  
  8. /* Use prototypes and ANSI libraries if __STDC__ */
  9. #ifdef __STDC__
  10. #  ifndef PROTO
  11. #    define PROTO
  12. #  endif /* !PROTO */
  13. #  define MODERN
  14. #endif /* __STDC__ */
  15.  
  16.  
  17. /* Use prototypes and ANSI libraries if Silicon Graphics */
  18. #ifdef sgi
  19. #  ifndef PROTO
  20. #    define PROTO
  21. #  endif /* !PROTO */
  22. #  define MODERN
  23. #endif /* sgi */
  24.  
  25.  
  26. /* Define MSDOS for Turbo C as well as Microsoft C */
  27. #ifdef __POWERC                 /* For Power C too */
  28. #  define __TURBOC__
  29. #endif /* __POWERC */
  30.  
  31.  
  32. /* Use prototypes and ANSI libraries if Microsoft or Borland C */
  33. #ifdef MSDOS
  34. #  ifndef PROTO
  35. #    define PROTO
  36. #  endif /* !PROTO */
  37. #  define MODERN
  38. #endif /* MSDOS */
  39.  
  40.  
  41. /* Turn off prototypes if requested */
  42. #ifdef NOPROTO
  43. #  ifdef PROTO
  44. #    undef PROTO
  45. #  endif /* PROTO */
  46. #endif /* NOPROT */
  47.  
  48.  
  49. /* Used to remove arguments in function prototypes for non-ANSI C */
  50. #ifdef PROTO
  51. #  define OF(a) a
  52. #else /* !PROTO */
  53. #  define OF(a) ()
  54. #endif /* ?PROTO */
  55.  
  56.  
  57. /* Allow far and huge allocation for small model (Microsoft C or Turbo C) */
  58. #ifdef MSDOS
  59. #  ifndef DYN_ALLOC
  60. #    define DYN_ALLOC
  61. #  endif
  62. #  ifdef __TURBOC__
  63. #    include <alloc.h>
  64. #  else /* !__TURBOC__ */
  65. #    include <malloc.h>
  66. #    define farmalloc _fmalloc
  67. #    define farfree   _ffree
  68. #  endif /* ?__TURBOC__ */
  69. #else /* !MSDOS */
  70. #  define huge
  71. #  define far
  72. #  define near
  73. #  define farmalloc malloc
  74. #  define farfree   free
  75. #endif /* ?MSDOS */
  76.  
  77. #define fcalloc   calloc
  78. /* Assumes that all arrays are < 64K for MSDOS */
  79.  
  80. /* Define MSVMS if either MSDOS or VMS defined */
  81. #ifdef MSDOS
  82. #  define MSVMS
  83. #else /* !MSDOS */
  84. #  ifdef VMS
  85. #    define MSVMS
  86. #  endif /* VMS */
  87. #endif /* ?MSDOS */
  88.  
  89.  
  90. /* Define void, voidp, and extent (size_t) */
  91. #include <stdio.h>
  92. #ifdef MODERN
  93. #  if !defined(M_XENIX) && !defined(__GNUC__)
  94. #    include <stddef.h>
  95. #  endif /* !M_XENIX */
  96. #  include <stdlib.h>
  97.    typedef size_t extent;
  98.    typedef void voidp;
  99. #else /* !MODERN */
  100.    typedef unsigned int extent;
  101. #ifndef M_XENIX
  102. #  define void int
  103. #endif
  104.    typedef char voidp;
  105. #endif /* ?MODERN */
  106.  
  107. /* Get types and stat */
  108. #ifdef VMS
  109. #  include <types.h>
  110. #  include <stat.h>
  111. #else /* !VMS */
  112. #  include <sys/types.h>
  113. #  include <sys/stat.h>
  114. #endif /* ?VMS */
  115.  
  116.  
  117. /* Cheap fix for unlink on VMS */
  118. #ifdef VMS
  119. #  define unlink delete
  120. #endif /* VMS */
  121.  
  122.  
  123. /* For Pyramid */
  124. #ifdef pyr
  125. #  define strrchr rindex
  126. #  define ZMEM
  127. #endif /* pyr */
  128.  
  129.  
  130. /* File operations--use "b" for binary if allowed */
  131. #ifdef MODERN
  132. #  define FOPR "rb"
  133. #  define FOPM "r+b"
  134. #  define FOPW "w+b"
  135. #else /* !MODERN */
  136. #  define FOPR "r"
  137. #  define FOPM "r+"
  138. #  define FOPW "w+"
  139. #endif /* ?MODERN */
  140.  
  141.  
  142. /* Define this symbol if your target allows access to unaligned data.
  143.  * This is not mandatory, just a speed optimization. The compressed
  144.  * output is strictly identical.
  145.  */
  146. #if defined(MSDOS) || defined(M_XENIX) || defined(i386) || defined(mc68020) || defined(vax)
  147. #   define UNALIGNED_OK
  148. #endif
  149.  
  150.  
  151. /* Under MSDOS we may run out of memory when processing a large number
  152.  * of files. Compile with MEDIUM_MEM to reduce the memory requirements or
  153.  * with MIN_MEM to use as little memory as possible.
  154.  */
  155. #ifdef SMALL_MEM
  156. #   define BSZ 2048   /* Buffer size for files */
  157. #else
  158. #ifdef MEDIUM_MEM
  159. #   define BSZ 8192
  160. #else
  161. #   define BSZ 16384
  162. #endif
  163. #endif
  164.  
  165. /* end of tailor.h */
  166.